<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNewsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('news', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->integer('store_id')->index()->nullable()->comment('门店ID');
            $table->string('title', '50')->index()->nullable()->comment('标题');
            $table->text('images_url')->nullable()->comment('封面图片地址');
            $table->text('content')->nullable()->comment('内容');
            $table->string('author', '50')->nullable()->comment('作者');
            $table->string('origin','50')->nullable()->comment('来源');
            $table->integer('time')->index()->nullable()->comment('发布时间戳');
            $table->integer('sort')->index()->nullable()->comment('排序（同级有效）');
            $table->integer('status')->index()->default(1)->comment('状态：1.正常，2.禁用');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('news');
    }
}
